//
//  main.swift
//  MySwift
//
//  Created by 周杨 on 14/11/2.
//  Copyright (c) 2014年 zhouy. All rights reserved.
//

import Foundation


/// 测试排序
func TestArr(){
    println("Hello, World!")
    
    
    var arry = [3,5,123,57,345,687,435,25,45,74,27,6]
    
    println("size \(arry.count)")
    
    for var i = 0,iSize = arry.count-1;i<iSize;++i {
        for var y = 0,ySize = arry.count-1;y<ySize;y++ {
            if(arry[y]>arry[y+1]){
                var temp = arry[y+1]
                arry[y+1] = arry[y]
                arry[y] = temp
            }
            
        }
        
    }
    
    for item in arry {
        print(" \(item) ")
        
    }
}

//单例模式
func TestSingle(){
    var obj = SingleObj.instance();
    obj.doExcute();
    obj.doPP1("xxxx", doPP2:"ppp");
}

//工厂模式
func TestMulObj(){
    var mulObj = MultitionObj.instance();
    mulObj.GetPerson("1");
    mulObj.GetPerson("2");
    mulObj.GetPerson("3");
    mulObj.GetPerson("4");
    mulObj.GetPerson("1");
    mulObj.GetPerson("2");
    mulObj.GetPerson("5");
    mulObj.GetPerson("1");
    var count = mulObj.GetDicSize();
    
    println(" mulObjCount \(count)");
}

func TestBallDrawing(){
    var ticketDraw = DoubleBallDrawing();
    
    var actionArr = NSMutableArray();
    actionArr.addObject(SelAction("历史号码验证机制", andSel: "isHistory:"));
    actionArr.addObject(SelAction("我的幸运篮球验证", andSel: "ValBlue:"));
    actionArr.addObject(SelAction("验证和值范围", andSel:"SumValidation:"));
    
    //actionArr.addObject(SelAction("我的幸运篮球验证", andSel: "ValBlue:"));
    
    for(var i=0,size=5;i<size;i++){
        ticketDraw.drawingStrat(actionArr);
    }
    
}

//TestArr();
//TestSingle();
//TestMulObj();

TestBallDrawing();
